From: Alex Elder Date: Fri, 20 Apr 2012 20:49:43 +0000 (-0500) Subject: ceph: osd_client: fix endianness bug in osd_req_encode_op() X-Git-Tag: archive/raspbian/4.9.13-1+rpi1~10^2~10609^2~165 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/?a=commitdiff_plain;h=065a68f9167e20f321a62d044cb2c3024393d455;p=linux-4.9.git ceph: osd_client: fix endianness bug in osd_req_encode_op() From Al Viro Al Viro noticed that we were using a non-cpu-encoded value in a switch statement in osd_req_encode_op(). The result would clearly not work correctly on a big-endian machine. Signed-off-by: Alex Elder --- diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 5e254055c910..daa2716a0c30 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -278,7 +278,7 @@ static void osd_req_encode_op(struct ceph_osd_request *req, { dst->op = cpu_to_le16(src->op); - switch (dst->op) { + switch (src->op) { case CEPH_OSD_OP_READ: case CEPH_OSD_OP_WRITE: dst->extent.offset =